<template>
    <section class="">
        <div>
        <div class="title_name" >产品信息</div>
        <!-- <el-button type="text" size="small">
            <i class="el-icon-edit"></i>编辑</el-button> -->
        <el-descriptions class="margin-top" title="" :column="3" :labelStyle="{'width': '200px'}"  size="" border>
            
            <el-descriptions-item>
                <template slot="label">
                    产品ID
                </template>
                {{productData.id}}
            </el-descriptions-item>
            <!-- <el-descriptions-item>
                <template slot="label">
                    所属子系统
                </template>
                智能工业
            </el-descriptions-item> -->
            <el-descriptions-item>
                <template slot="label">
                    所属项目
                </template>
                <!-- 中山大学 -->
                {{productData.projectName}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    消息协议
                </template>
                {{productData.messageProtocol}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    链接协议
                </template>
                {{productData.transportProtocol}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    设备类型
                </template>
                {{productData.deviceType}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    描述
                </template>
                {{productData.description}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    设备厂家
                </template>
                {{productData.vender}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    设备型号
                </template>
                {{productData.model}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    供应商联系人
                </template>
                {{productData.supplierName}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    供应商联系方式
                </template>
                {{productData.supplierPhone}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    安装日期
                </template>
                {{productData.installationDate}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    安装位置
                </template>
                {{productData.namehouse}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    开始使用时间
                </template>
                {{productData.startTime}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    报废日期
                </template>
                {{productData.scrapTime}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    设备负责人
                </template>
                {{productData.principal}}
            </el-descriptions-item>
        </el-descriptions>
    </div>
    <div>
        <!-- <div class="title_name" >配置</div><el-button type="text" size="small"><i class="el-icon-edit"></i>编辑</el-button>
        <div class="config_name" >MQTT 认证配置</div>
        <el-descriptions class="margin-top" title="" :column="2" size="" :labelStyle="{'width': '200px'}"  border>
            
            <el-descriptions-item  >
                <template slot="label">
                    用户
                </template>
                kooriookami
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    密码
                </template>
                智能工业
            </el-descriptions-item>
            
        </el-descriptions> -->
    </div>
    </section>
</template>

<script>
    import {iotproductbyid } from "../../url/api"
    export default {
        data() {
            return {
                activeName: 'cpxx',
                productData: {},
                producturl: '',
                srcList: []
            };
        },
        methods: {
            handleClick(tab, event) {
                // console.log(tab, event);
            },
            getdata() {
                let row = JSON.parse(sessionStorage.getItem('productData'));

                // console.log(row,"QQQQQQQQQQ");
                // JSON.parse(JSON.stringify(this.$route.query.row));
                let params = {
                    id: row.id
                }
                iotproductbyid(params).then((res) => {
                    //console.log(res)
                    if (res.data.ok == true) {
                        this.productData = res.data.data;
                    } else {
                        this.$message(res.data.message);
                    }
                    console.log(this.productData);
                })
                this.producturl = this.productData.photoUrl;
                this.srcList.push(this.productData.photoUrl);
                console.log(this.productData);
            },
            

        },
        mounted() {
            this.getdata();
        },
    }
</script>
<style scoped>
    .title_name{
        display: inline-block;
        font-size: 17px;
        margin: 10px 20px 20px 5px;
    }
    .config_name{
        margin: 0px 0px 5px 5px;
    }
</style>